<?php

class LoginView extends View {
	
	protected $error;
	
	function __construct() {
	
	}
	
	function getError() {
		return $this->error;
	}
	
	function setError($e) {
		$this->error = $e;
	}
	
	function display() {
	
		echo '<div style="width:90%">';
		if (isset($_POST['action'])) {
			if ($this->error) {
				echo '<h3 style="color:red">User authentication failed. Please try again</h3>';
			}
		}
		echo '<form action="" method="POST">';
		echo '<input type="hidden" name="action" value="save">';
		echo '<table>';
		echo '<tr><td>Username:</td><td><input type="text" name="username" /></td></tr>';
		echo '<tr><td>Password:</td><td><input type="password" name="password" /></td></tr>';
		echo '<tr><td></td><td><input type="submit" value="Login" class="btn btn-default" /></td></tr>';
		echo '</table>';
		echo '</form>';
		echo '</div>';
	}

}